package com.chain.BrotherExchange.data.model;

import com.chain.BrotherExchange.C;
import com.chain.BrotherExchange.R;
import com.google.gson.annotations.SerializedName;

public class UserIsAuthentication extends BaseResponseModel<UserIsAuthentication.DataBeanX> {


    public static class DataBeanX {
        /**
         * data : {"real_name":"","identify_card":"","check_mark_first":0,"check_mark_second":0}
         */

        @SerializedName("data") private DataBean dataX;

        public DataBeanX() {
        }

        public DataBeanX(DataBean dataX) {

            this.dataX = dataX;
        }

        public DataBean getDataX() {
            return dataX;
        }

        public void setDataX(DataBean dataX) {
            this.dataX = dataX;
        }

        public static class DataBean {
            public DataBean() {
            }

            public DataBean(int check_mark_first) {
                this.check_mark_first = check_mark_first;
            }

            /**
             * real_name :
             * identify_card :
             * check_mark_first : 0
             * check_mark_second : 0
             */

            private String real_name;
            private String identify_card;
            private int check_mark_first;
            private int check_mark_second;

            public String getReal_name() {
                return real_name;
            }

            public String getEncryptRealName() {
                if (real_name == null || real_name.length() <= 1) {
                    return real_name;
                }

                return real_name.substring(0, 1) + "**";
            }

            public String getEncryptRealId() {
                if (identify_card == null|| identify_card.length() <= 6) {
                    return identify_card;
                }

                return identify_card.substring(0, 2) + "****"
                        + identify_card.substring(identify_card.length() - 4, identify_card.length());
            }

            public void setReal_name(String real_name) {
                this.real_name = real_name;
            }

            public String getIdentify_card() {
                return identify_card;
            }

            public void setIdentify_card(String identify_card) {
                this.identify_card = identify_card;
            }

            public int getCheck_mark_first() {
                return check_mark_first;
            }

            public int getRealNameAuthenticationText() {
                switch (check_mark_first) {
                    case C.API_AUTHENTICATION_SUCCESS:
                        return R.string.authentication_success;
                    case C.API_AUTHENTICATION_FAILURE:
                        return R.string.authentication_failure;
                    case C.API_IN_AUTHENTICATION:
                        return R.string.in_authentication;
                    default:
                        return R.string.unauthorized;
//                    case C.API_UNAUTHORIZED:
//                        return R.string.unauthorized;
                }
            }

            public void setCheck_mark_first(int check_mark_first) {
                this.check_mark_first = check_mark_first;
            }

            public int getCheck_mark_second() {
                return check_mark_second;
            }

            public void setCheck_mark_second(int check_mark_second) {
                this.check_mark_second = check_mark_second;
            }

            public int getLevel2CertificationText() {
                switch (check_mark_second) {
                    case C.API_AUTHENTICATION_SUCCESS:
                        return R.string.authentication_success;
                    case C.API_AUTHENTICATION_FAILURE:
                        return R.string.authentication_failure;
                    case C.API_IN_AUTHENTICATION:
                        return R.string.in_authentication;
                    default:
                        return R.string.unauthorized;
//                    case C.API_UNAUTHORIZED:
//                        return R.string.unauthorized;
                }
            }
        }
    }
}
